<template>
  <div class="dashboard-editor-container">
    <panel-group @handleSetLineChartData="handleSetLineChartData" />

    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <line-chart :chart-data="lineChartData" />
    </el-row>

    <el-row :gutter="32">
     
      <div class="table" style="width:98%;margin-left:16px;floa:left">
        <h3>美容服务订单</h3>
        <el-table :data="tableData">
          <el-table-column label="订单号" prop="num" align="center"></el-table-column>
          <el-table-column label="金额" prop="money" align="center"></el-table-column>
          <el-table-column prop="time" align="center" label="下单时间"></el-table-column>
          <el-table-column prop="user" align="center" label="下单用户"></el-table-column>
          <el-table-column prop="phone" align="center" label="联系方式"></el-table-column>
          <el-table-column  align="center" label="订单状态" prop="state"></el-table-column>
        </el-table>
      </div>
    </el-row>
  </div>
</template>

<script>
import LineChart from "./components/LineChart";
import PanelGroup from "./components/PanelGroup";

const lineChartData = {
  newVisitis: {
    expectedData: [100, 120, 161, 134, 105, 160, 165],
    actualData: [120, 90, 100, 154, 162, 140, 145]
  }
};

export default {
  name: "DashboardAdmin",
  components: {
    LineChart,
    PanelGroup
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis,
      tableData: [
        {
          num: "4865215355456212321",
          money: "￥600",
          state: "已接单",
          time: "2019-12-01 19:34",
          phone: "13199451349",
          area: "浙江省杭州市下城区下沙大都会风情苑8幢6单元902室",
          user: "赵先生"
        },
        {
          num: "8785212123123123123",
          money: "￥1200",
          state: "待接单",
          user: "黄女士",
          area: "浙江省杭州市下城区下沙大都会风情苑8幢4单元502室",
          time: "2019-12-01 19:34",
          phone: "13199451349"
        },
        {
          num: "8978212312121231232",
          time: "2019-12-01 19:34",
          money: "￥1600",
          state: "已接单",
          user: "刘女士",
          phone: "13199451349",
          area: "浙江省杭州市下城区下沙大都会风情苑11幢1单元101室"
        },
        {
          num: "4865215355456212321",
          time: "2019-12-01 19:34",
          area: "浙江省杭州市下城区下沙大都会风情苑7幢9单元702室",
          user: "刘女士",
          phone: "13199451349",
          money: "￥1600",
          state: "待接单"
        },
        {
          num: "7841235645231365112",
          user: "赵先生",
          time: "2019-12-01 19:34",
          area: "浙江省杭州市下城区下沙大都会风情苑8幢6单元902室",
          phone: "13199451349",
          money: "￥500",
          state: "待接单"
        }
      ]
    };
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type];
    }
  }
};
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
